Home:ALL Converter>How can I minimize/maximize windows in macOS with the Cocoa API from a Python script?

How can I minimize/maximize windows in macOS with the Cocoa API from a Python script?

Ask Time:2018-11-10T16:27:07         Author:Al Sweigart

Json Formatter

How can I minimize/maximize windows in macOS from a Python script? On Windows, there's a win32 api (the ShowWindow() function) that can do this. I'd like the macOS equivalent. I'd like to have a script be able to find a window from its title, then minimize or maximize it.

Is this possible? I assume I need to use the pyobjc module for this.

Author:Al Sweigart,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/53237266/how-can-i-minimize-maximize-windows-in-macos-with-the-cocoa-api-from-a-python-sc
yy